<?php

class MasterBackOffice extends TTemplateControl {

  public function OnInit($param) {
    parent::OnInit($param);
  }

  public function onLoad($param) {
    parent::onLoad($param);
    $this->iniciarControles();
    $this->cargaLogin();
  }

  public function iniciarControles() {
  }

  public function cargaLogin() {
    $oUsuario = Util::getSession("Usuario");
    if (Util::isNullOrEmpty($oUsuario)) {
      $this->Response->redirect($this->Service->constructUrl("Home"));
    } else {
      $this->lblUsuario->Text = $oUsuario->getUsuario();
      $this->lblMenu->Text = $this->obtenerMenu($oUsuario);
    }
  }
  
  public function obtenerMenu(){
    $strMenu = "";
    $strMenu = "<a href='index.php?page=Escort.Listar'>Escort</a>&nbsp;|&nbsp;";
    $strMenu .= "<a href='index.php?page=Usuario.Listar'>Usuario</a>";
    return $strMenu;
  }

  public function btnCerrarSessionClick($sender, $param) {
    $session = new THttpSession();
    $session->clear();
    $session->close();
    $this->cargaLogin();
  }

}

?>